<%@page import="java.io.Console"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="beans.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		request.setCharacterEncoding("utf-8");
		String userno = request.getParameter("userno");//注意，如果input设置成disabled，则无法传递数据
		
		String userpwd = request.getParameter("userpwd");
		String userpwdagain = request.getParameter("userpwdagain");

		String username = request.getParameter("username");
		String usersex = request.getParameter("usersex");
		String userage = request.getParameter("userage");
		String useraddress = request.getParameter("useraddress");
		String userprofession = request.getParameter("userprofession");
		String useremail = request.getParameter("useremail");
		String userphoto = request.getParameter("userphoto");
		String usersummary = request.getParameter("usersummary");
		
		String []userinterests = request.getParameterValues("userinterest");
		String userinterest="";
		for(int i=0;i<userinterests.length;i++){
			userinterest=userinterest+userinterests[i]+"-";
		}
		userinterest=userinterest.substring(0, userinterest.length()-1);
		boolean flag;
		flag=true;//假定提交能够成功
		UserDAO userDAO=new UserDAO();
		flag=userDAO.update(userno, userpwd, username, usersex, userage, useraddress, userprofession, userinterest, useremail, userphoto, usersummary);
		
		if(flag){			
			response.sendRedirect("modiself.jsp");			
		}else{
			response.sendRedirect("error.jsp");
		}
		
	%>
	<%=userinterests[0] %>

	
</body>
</html>